package ooday2zy;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑",2,"黑色");
        System.out.println(dog.name);
        dog=null;
        System.out.println(dog.name);















        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑",2,"黑");
        dogs[1] = new Dog("小白",1,"白");
        dogs[2] = new Dog("小灰",3,"灰");
        System.out.println(dogs[0].name);
        dogs[1].age = 4;

        for (int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();

        }




















        /*
        Fish xh=new Fish("小红",20,"绿色");
        xh.eat();
        xh.drink();
        Dog xl=new Dog("小兰",25,"白色");
        xl.lookHome();
        xl.eat();
        xl.drink();
        Chick xg=new Chick("小缸",22,"黑白花");
        xg.eat();
        xg.drink();
        xg.layEggs();

         */
    }
}

